<template>
  <div>
    <el-dialog :title="captcha.name" :visible="dialogVisable.visable" width="30%">
      <el-image
        style="width: 100%; height: 100%"
        :src="captcha.base64String"
        fit="contain"
      ></el-image>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisable.visable = false"
          >关 闭</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "",
  components: {},
  props: ["dialogVisable"],
  data() {
    return {
      captcha: {
        name: "",
        base64String: "",
      },
    };
  },
  computed: {},
  watch: {},
  methods: {},
  created() {},
  mounted() {
    this.$bus.$on("captchaData", (data) => {
      this.captcha = data;
      this.captcha.base64String =
        "data:image/png;base64," + this.captcha.base64String;
    });
  },
  beforeCreate() {},
  beforeMount() {},
  beforeUpdate() {},
  updated() {},
  beforeDestroy() {},
  destroyed() {
    this.$bus.$off("captchaData");
  },
  activated() {},
};
</script>
<style scoped>
</style>